import rxAjax from '@/assets/js/ajax.js';

//考勤周期明细 api接口
export const AtsattenceCycleDetailApi = {};

AtsattenceCycleDetailApi.baseUrl= '/api-oa/oa/ats/atsattenceCycleDetail';
AtsattenceCycleDetailApi.exportUrl= AtsattenceCycleDetailApi.baseUrl + '/listExport';

//查询列表
AtsattenceCycleDetailApi.query=function (parameter) {
  var url= AtsattenceCycleDetailApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

/**
* 获取单记录
* @param pkId
* @returns {*}
*/
AtsattenceCycleDetailApi.get =function(pkId) {
  var url= AtsattenceCycleDetailApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

//保存数据
AtsattenceCycleDetailApi.save =function(parameter) {
  var url= AtsattenceCycleDetailApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

//删除数据
AtsattenceCycleDetailApi.del =function(parameter) {
  var url= AtsattenceCycleDetailApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

AtsattenceCycleDetailApi.getMainId = function (cId) {
  var url = AtsattenceCycleDetailApi.baseUrl + '/getMainId?cId=' + cId;
  return rxAjax.get(url);
}

export  default AtsattenceCycleDetailApi;

